# -*- coding:utf8 -*-

from flask import Flask

from flask.ext.pymongo import PyMongo
from flask.ext.login import LoginManager
from flask.ext.assets import Environment, Bundle

__author__ = 'cosven'

# app初始化
app = Flask(__name__)

# config mongodb database
app.config['MONGO_DBNAME'] = 'blog'
app.config['MONGO_HOST'] = '127.0.0.1'
app.config['MONGO_PORT'] = 27017
app.config.from_pyfile('flaskapp.cfg')

mongo = PyMongo(app, config_prefix='MONGO')

# login manager 初始化
login_manager = LoginManager()
login_manager.init_app(app)

# assets 初始化和相关assets配置
assets = Environment(app)

import blog.routes
import blog.assets